Matthew Talluto
03.11.2020
Intuitively: the test is good, so the probability that a positive testing individual is a zombie should be high
(many people answer 99%, given the false positive rate of 1%).
Unintuitively: zombies are very rare, so when testing many people randomly, many tests will be false positives.
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
| Test+ | Test- | Sum | |
|---|---|---|---|
| Zombie | – | – | – |
| Not Zombie | – | – | – |
| Sum | – | – | 1,000,000 |
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
| Test+ | Test- | Sum | |
|---|---|---|---|
| Zombie | – | – | 1,000 |
| Not Zombie | – | – | 999,000 |
| Sum | – | – | 1,000,000 |
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
| Test+ | Test- | Sum | |
|---|---|---|---|
| Zombie | 995 | 5 | 1,000 |
| Not Zombie | – | – | 999,000 |
| Sum | – | – | 1,000,000 |
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
| Test+ | Test- | Sum | |
|---|---|---|---|
| Zombie | 995 | 5 | 1,000 |
| Not Zombie | 9,990 | 989,010 | 999,000 |
| Sum | 10,985 | 989,015 | 1,000,000 |
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
| Test+ | Test- | Sum | |
|---|---|---|---|
| Zombie | 995 | ||
| Not Zombie | 9,990 | ||
| Sum | 10,985 |
0.1% of the population is infected with a parasite that will turn them into zombies.
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
0.1% of the population is infected with a parasite that will turn them into zombies.
false negative rate = 0.5%
false positive rate = 1%
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
\(pr(T | Z) = 1 - pr(T' | Z) = 1 - 0.005 = 0.995\)
\(pr(T' | Z') = 1 - pr(T | Z') = 1 - 0.01 = 0.99\)
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
Given
\(pr(Z) = 0.001\)
\(pr(T' | Z) = 0.005\)
\(pr(T | Z') = 0.01\)
\(pr(Z,T) = pr(T|Z)pr(Z) = 0.995 \times 0.001 = 0.000995\)
\[pr(Z|T) = \frac{pr(T|Z)pr(Z)}{pr(T)}\]
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
Given
\(pr(Z) = 0.001\)
\(pr(T' | Z) = 0.005\)
\(pr(T | Z') = 0.01\)
Known
\(pr(T | Z) = 0.995\)
\(pr(T' | Z') = 0.99\)
\[pr(Z|T) = \frac{pr(T|Z)pr(Z)}{pr(T)}\]
\[ \begin{aligned} pr(T) & = pr(T,Z) + pr(T,Z') \\ & = pr(T|Z)pr(Z) + pr(T|Z')pr(Z') \\ & = 0.995 \times 0.001 + 0.01 \times 0.999 \\ & = 0.000995 + 0.000999 \\ & = 0.010985 \end{aligned} \]
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
Given
\(pr(Z) = 0.001\)
\(pr(T'| Z) = 0.005\)
\(pr(T | Z') = 0.01\)
Known
\(pr(T | Z) = 0.995\)
\(pr(T' | Z') = 0.99\)
\(pr(Z,T) = 0.000995\)
\[ \begin{aligned} pr(Z|T) & = \frac{pr(T|Z)pr(Z)}{pr(T)} \\ & = \frac{0.995 \times 0.001}{0.010985} \\ & = 0.0906 \end{aligned} \]
Desired outcome: \(pr(Z | T)\)
(if I test positive, what is the probability I am a zombie?)
Given
\(pr(Z) = 0.001\)
\(pr(T' | Z) = 0.005\)
\(pr(T | Z') = 0.01\)
Known
\(pr(T | Z) = 0.995\)
\(pr(T' | Z') = 0.99\)
\(pr(Z,T) = 0.000995\)
\(pr(T) = 0.010985\)
| Observed | Not Observed | |
|---|---|---|
| Present | ? | ? |
| Absent | ? | ? |
\[ \begin{aligned} pr(A,B) & = pr(A|B)pr(B) \\ \end{aligned} \]
\[ \begin{aligned} pr(A,B) & = pr(A|B)pr(B) \\ \end{aligned} \]
\[ \begin{aligned} pr(A,B,C) & = pr(A|B,C)pr(B,C) \\ & = pr(A|B,C)pr(B|C)pr(C) \end{aligned} \]
\[ \begin{aligned} pr(A,B) & = pr(A|B)pr(B) \\ \end{aligned} \]
\[ \begin{aligned} pr(A,B,C) & = pr(A|B,C)pr(B,C) \\ & = pr(A|B,C)pr(B|C)pr(C) \end{aligned} \]
\[ \begin{aligned} pr(\bigcap_{k=1}^{n} A_k) & = pr(A_n | \bigcap_{k=1}^{n-1} A_k )pr(\bigcap_{k=1}^{n-1} A_k) \\ & =\prod_{k=1}^{n}pr(A_k | \bigcap_{j=1}^{k-1}A_j) \end{aligned} \]
\[pr(k = 0 | n = 10, p = 0.3) = (0.7 \times \ldots 0.7) = 0.7^{10} \approx 0.028 \]
\[pr(k = 0 | n = 10, p = 0.3) = 0.3^{10} \approx 0.000 \]
\[pr(Z_1,Z'_{2..10}) = 0.3 \times0.7^9 \approx 0.012 \]
\[pr(k=1|n=10,p=0.3) = 10 \times 0.3 \times0.7^9 \approx 0.121\]
\[pr(Z_{a}, Z'_{a'}) = p^k(1 - p)^{(n - k)}\]
\[pr(k|n,p) = {n \choose k} p^k(1-p)^{(n-k)}\]
This is the probability mass function (PMF) of the binomial distribution (dbinom in R) \[pr(k|n,p) = {n \choose k} p^k(1-p)^{(n-k)}\]
This is the probability mass function (PMF) of the binomial distribution (dbinom in R) \[pr(k|n,p) = {n \choose k} p^k(1-p)^{(n-k)}\]
What is the probability of observing $ k$ events? Cumulative distribution function (CDF)
\[ pr(X \le k|n,p) = \sum_{i=0}^{k} {n \choose i}p^i(1-p)^{(n-i)} \]
\[\mu = \frac{pr}{1-p}\] \[ s^2 = \mu + \frac{\mu^2}{r} \]
d functions in R (probability density) – dnorm, dgamma, etcp functions in R (cumulative probability) – pnorm, pgamma, etc